home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-16 | 1.2 KB | 43 lines | [TEXT/MPCC] |
- if(MetafileFileSpecify( &theFileSpec )) {
-
- SetCursor(*(GetCursor(watchCursor)));
-
- // Initialize QuickDraw 3D, open a connection to the QuickDraw 3D library
- myStatus = Q3Initialize();
- if ( myStatus == kQ3Failure ) {
- DebugStr("\pErInitialize returned failure.");
- ExitToShell() ;
- }
-
- // install the error handler - this gets called whenever
- // an error occurs, which means we don't have to check so
- // much
- Q3Error_Register( MyErrorHandler, 0L );
- Q3Warning_Register( MyWarningHandler, 0L );
-
- // set up our globals
- gQuitFlag = false ;
- gMainWindow = NewCWindow(nil,&rBounds,title,false,noGrowDocProc,(WindowPtr)-1,true,nil); ;
-
- // initialise our document structure
- InitDocumentData( &gDocument ) ;
-
- // try to read the file into the main display group
- if((gDocument.fModel = MyNewModelFromFile(&theFileSpec)) != NULL ) {
-
- AdjustCamera( &gDocument,
- (gMainWindow->portRect.right - gMainWindow->portRect.left),
- (gMainWindow->portRect.bottom - gMainWindow->portRect.top) ) ;
-
- SetWTitle( gMainWindow, theFileSpec.name );
- ShowWindow( gMainWindow ) ;
- SetPort( gMainWindow ) ;
-
- SetCursor(&qd.arrow) ;
- MainEventLoop();
-
- }
- }
-
- DisposeDocumentData( &gDocument ) ;
-